package question1.test1;

import java.util.Scanner;

public class ExceptionDemo {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("输入一个数");
        int a=sc.nextInt();
        System.out.println("输入一个数");
        int b=sc.nextInt();
        try {
            System.out.println(a/b);
        } catch (ArithmeticException e) {
            //e.printStackTrace();
            System.out.println("第二个数不能为0");
        }

    }
}
